package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.BestTime;
import cn.wolfcode.luowowo.article.mapper.BestTimeMapper;
import cn.wolfcode.luowowo.article.service.IBestTimeService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class BestTimeServiceImpl implements IBestTimeService {
    @Autowired
    private BestTimeMapper bestTimeMapper;

    @Override
    public void saveOrUpdate(BestTime bestTime) {
        if (bestTime.getId()==null){
            bestTimeMapper.insert(bestTime);
            return;
        }
        bestTimeMapper.updateByPrimaryKey(bestTime);
    }

    @Override
    public BestTime get(Long id) {
        return bestTimeMapper.selectByPrimaryKey(id);
    }
}
